//==================================================================
//  Copyright (C) 2006-2007  Davide Pasca
//
//  This library is free software; you can redistribute it and/or
//  modify it under the terms of the GNU Lesser General Public
//  License as published by the Free Software Foundation; either
//  version 2.1 of the License, or (at your option) any later version.
//
//  This library is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//  Lesser General Public License for more details.
//
//  You should have received a copy of the GNU Lesser General Public
//  License along with this library; if not, write to the Free Software
//  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
//==================================================================
/// @file
///
///
/// 
/// @author Davide Pasca
/// 
//==================================================================

#ifndef REND_SYSTEM_H
#define REND_SYSTEM_H

#include "rend_device.h"

//==================================================================
#ifdef _DEBUG
	#define PGLERRORCHECK			PSYS::GLErrorCheck( _T(__FILE__), __LINE__ )
#else
	#define PGLERRORCHECK			(0)
#endif

//==================================================================
#ifdef TARGET_D3D
typedef IDirect3D9	RendSystemContext;
#else
typedef void		RendSystemContext;
#endif

//==================================================================
///
//==================================================================
class RendSystem
{
private:
	RendSystemContext	*_contextp;

public:
	static RendSystem	&Instance() { static RendSystem instance; return instance; }

protected:
	RendSystem();
	~RendSystem();

public:
	 RendDevice	*NewRendDevice( u_int w, u_int h, const TCHAR *basepathp );

	 static RendDevice	*NewRendDevice_s( u_int w, u_int h, const TCHAR *basepathp )
	 {
		return Instance().NewRendDevice( w, h, basepathp );
	 }
};

#endif
